package com.cby.android.base.kotlin

import android.app.Activity
import android.content.Intent
import android.widget.Toast

/**
 * @description: ActivityExt
 *
 * @author ChenBaoyang
 * @date 2021/10/26 09:50
 */
fun Activity.showToast(text: String) {
    Toast.makeText(this.applicationContext, text, Toast.LENGTH_SHORT).show()
}

fun Activity.start(clazz: Class<*>) {
    startActivity(Intent(this, clazz))
}

fun Activity.start(clazz: Class<*>,flag: Int) {
    val intent = Intent(this, clazz)
    intent.addFlags(flag)
    startActivity(intent)
}